package online.heycm.rbac.service.basic;

import online.heycm.platform.common.entity.result.Optional;
import online.heycm.platform.common.entity.result.PageResult;
import online.heycm.rbac.param.basic.InterfaceAddReq;
import online.heycm.rbac.param.basic.InterfaceEditReq;
import online.heycm.rbac.param.basic.InterfaceListReq;
import online.heycm.rbac.param.basic.InterfacePageReq;
import online.heycm.rbac.param.basic.InterfaceRes;
import online.heycm.rbac.param.basic.ResourceAddReq;
import online.heycm.rbac.param.basic.ResourceEditReq;
import online.heycm.rbac.param.basic.ResourceListReq;
import online.heycm.rbac.param.basic.ResourcePageReq;
import online.heycm.rbac.param.basic.ResourceRes;
import online.heycm.rbac.param.basic.RoleAddReq;
import online.heycm.rbac.param.basic.RoleEditReq;
import online.heycm.rbac.param.basic.RoleInterfaceAddReq;
import online.heycm.rbac.param.basic.RoleRes;
import online.heycm.rbac.param.basic.RoleResourceAddReq;

import java.util.List;

/**
 * 基础服务 - 资源权限
 *
 * @author hey
 * @version 1.0
 * @date 2024/1/17 15:11
 */
public interface RbacService {

    Optional addRole(RoleAddReq req);

    Optional editRole(RoleEditReq req);

    Optional<List<RoleRes>> listRole();

    Optional addInterface(InterfaceAddReq req);

    Optional editInterface(InterfaceEditReq req);

    Optional<List<InterfaceRes>> listInterface(InterfaceListReq req);

    Optional<PageResult<InterfaceRes>> pageInterface(InterfacePageReq req);

    Optional<List<Integer>> listRoleInterface(Integer roleId);

    Optional addRoleInterface(RoleInterfaceAddReq req);

    Optional addResource(ResourceAddReq req);

    Optional editResource(ResourceEditReq req);

    Optional<List<ResourceRes>> listResource(ResourceListReq req);

    Optional<PageResult<ResourceRes>> pageResource(ResourcePageReq req);

    Optional<List<ResourceRes>> treeResource();

    Optional<List<Integer>> listRoleResource(Integer roleId);

    Optional addRoleResource(RoleResourceAddReq req);
}
